package jrain.fw.core.log;

import jrain.fw.core.business.BusinessConst;
import jrain.fw.core.business.BusinessRequest;
import jrain.utils.lang.StringUtils;

public class BaseLogger {

	// out-----------------------------------------------------
	protected String formart(String format, Object... argArray) {
		format = format.replace("{}", "%s");
		String msg = String.format(format, argArray);
		return msg;
	}

	protected String getTraceId(BusinessRequest request) {
		return StringUtils.trimNull(request.getExtData(BusinessConst.EXT_TRACE_ID));
	}

	protected String getTraceMsg(BusinessRequest request, String msg) {
		String traceId = getTraceId(request);
		String traceMsg = "[[" + request.getKey() + "." + traceId + "]]"+msg;
		return traceMsg;
	}
	
	
	 

}
